import sbt._
import Keys._
import play.Project._
import com.typesafe.sbt.SbtAspectj._
import com.typesafe.sbt.SbtAspectj.AspectjKeys._

object ApplicationBuild extends Build {

  val appDependencies = Seq(javaCore, filters)

  val appName = "websocket-logger"
  val appVersion = "1.0"
  
  val main = play.Project(appName, appVersion, appDependencies)
    .settings(aspectjSettings: _*)
    .settings(
      libraryDependencies += "org.springframework" % "spring-aspects" % "3.1.4.RELEASE",
      libraryDependencies += "org.springframework.security" % "spring-security-aspects" % "3.1.4.RELEASE",
      libraryDependencies += "org.springframework" % "spring-tx" % "3.1.4.RELEASE",
      libraryDependencies += "javax.persistence" % "persistence-api" % "1.0",
      sourceLevel := "-1.7",
      verbose in Aspectj := true,
      showWeaveInfo in Aspectj := true,
      inputs in Aspectj <+= compiledClasses,
      binaries in Aspectj <++= update map { report =>
        report.matching(
          moduleFilter(organization = "org.springframework", name = "spring-aspects")
            || moduleFilter(organization = "org.springframework.security", name = "spring-security-aspects")
        )
      },
      products in Compile <<= products in Aspectj,
      products in Runtime <<= products in Compile
    )
}